import { BeforeInsert } from "typeorm";

/** 数据库插入之前不能是函数 */
export class NotFunction {
  @BeforeInsert()
  notFunction () {
    for (const k in this) {
      if (typeof this[k] === "function") {
        //@ts-ignore
        this[k] = this[k].toString();
      }
    }
  }
}